﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;

namespace Group_Project_Book_Store
{
    /// <summary>
    /// Payer is the person the invoice is being billed to, an invoice has one payer
    /// </summary>
    class clsPayer
    {
        /// <summary>
        /// Unique ID for a payer in the system
        /// </summary>
        public int payerID { get; set; }
        /// <summary>
        /// First and Last name for payer
        /// </summary>
        public string payerName { get; set; }
        /// <summary>
        /// Address the invoice is going to
        /// </summary>
        public string payerAddress { get; set; }
        /// <summary>
        /// City of the payer
        /// </summary>
        public string payerCity { get; set; }
        /// <summary>
        /// Postal Code of the payer
        /// </summary>
        public string payerPostalCode { get; set; }
        /// <summary>
        /// Phone of the payer
        /// </summary>
        public string payerPhone { get; set; }
        /// <summary>
        /// Email of the payer
        /// </summary>
        public string payerEmail { get; set; }
        /// <summary>
        /// ZIP code for payer
        /// </summary>
        public string payerZIP { get; set; }
        /// <summary>
        /// Method to override payer name to string
        /// </summary>
        /// <returns></returns>
        public override string ToString()
        {
            try
            {
                return payerName;
            }
            catch (Exception ex)
            {   
                MessageBox.Show(ex.Message);
                return null;
            }
        }
        /// <summary>
        /// Method to display payer address information
        /// </summary>
        /// <param name="payer"></param>
        /// <returns></returns>
        static public string DisplayPayerAddressInformation(clsPayer payer)
        {
            try {
                return payer.payerName + "\r" + payer.payerAddress + "\r" + payer.payerCity + ", " + payer.payerPostalCode + " " + payer.payerZIP;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
                return null;
            }
        }
    }
}
